# -*- coding: utf-8 -*-
import scrapy
from ..items import NewsItem


class Jin10Spider(scrapy.Spider):
    name = 'jin10'
    allowed_domains = ['jin10.com']
    start_urls = ['http://jin10.com/']

    def parse(self, response):
        main = response.css(".jin-flash")
        for time, news in zip(main.css(".jin-flash_time"), main.css(".jin-flash_b h4")):
            item = NewsItem()
            item["time"] = time.css("::text").extract()
            item["news"] = news.css("::text").extract()
            item["websites"] = Jin10Spider.name
            yield item
        pass
